﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SyndicateDAO.Classes;
using SyndicateDAO.DatabaseObject;

namespace SyndicateDAO.DAO
{
    public class PlayerDAO : DataBaseHelper<player>
    {


        public IQueryable<player> SelectAllByDrawId(int dId)
        {
            return this.SelectAll().Where(c => c.drawId == dId);
        }
        public bool InsertPlayer(player l)
        {
            return this.Insert(l);
        }
        public bool UpdatePlayer()
        {
            return this.Update();
        }
        public bool DeletePlayer(player l)
        {
            return this.Delete(l);
        }

        public IQueryable<draw> SelectDrawsByPlayerId(int pId)
        {
            return this.SelectAll().Where(p => p.userId == pId).Select(p => p.draw);
        }
    }
}
